package com.stud.seckill.common.auth;

import com.stud.seckill.entity.UserEntity;

/**
 * 用户信息上下文
 */
public class UserContext {

    private static final ThreadLocal<UserEntity> userThreadLocal = new ThreadLocal<>();

    public static void setUser(UserEntity tUser) {
        userThreadLocal.set(tUser);
    }

    public static UserEntity getUser() {
        return userThreadLocal.get();
    }

}
